namespace utils {

	export function call(callee: Function, caller?: any, ...params: any[]): void {
		!!caller ? Reflect.apply(callee, caller, params) : callee(...params);
	}

	export function wait(seconds: number, callee: () => any): number {
		return egret.setTimeout(callee, this, seconds * 1000);
	}

	export function every(seconds: number, callee: () => any): number {
		return egret.setInterval(call, this, seconds * 1000);
	}

	export function clear(timeout: number): any {
		egret.clearTimeout(timeout); return utils;
	}

	export function secondToFrame(second: number): number {
		return second * game.frameRate;
	}
}